<?php

class BlogViewMod extends \Syrius\Model\View {
	protected $_table = "blogView";
	protected $_select = "SELECT id,titolo from blog";

}

class Author extends \Syrius\Model\Model {
	protected $_table = "author";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $firstname = array("type" => "varchar");
	protected $lastname = array("type" => "varchar");
}

class Publisher extends \Syrius\Model\Model {
	protected $_table = "publisher";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $name = array("type" => "varchar");
}

class Book extends \Syrius\Model\Model {
	protected $_table = "book";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $title = array("type" => "varchar");
	protected $isbn = array("type" => "varchar");
	protected $publisher = array("type" => "relation", "extra_type" => "one", "mapper" => "publisher");
	protected $author = array("type" => "relation", "extra_type" => "one", "mapper" => "author");
}


class BlogView extends \Syrius\Model\View {
	protected $_table = "blogView";
	protected $_select = "SELECT * from blog";

}

class Blog extends \Syrius\Model\Model {
	protected $_table = "blog";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $titolo = array("type" => "varchar");
}

class Comment extends \Syrius\Model\Model {
	protected $_table = "commenti";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $blog = array("type" => "relation", "extra_type" => "one", "mapper" => "blog");
}

class Tag extends \Syrius\Model\Model {
	protected $_table = "tag";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $name = array("type" => "varchar");
	protected $blogs = array("type" => "relation", "extra_type" => "many_to_many", "mapper" => "blog");
}

class Blog_Modifica extends \Syrius\Model\Model {
	protected $_table = "blog";
	protected $id = array("type" => "int", "primary" => true, "unique" => true, "serial" => true, "comment" => "Autoincremento");
	protected $titolo = array("type" => "varchar");
	protected $testo = array("type" => "text", "null" => false);
}

class Comment_Mod extends \Syrius\Model\Model {
	protected $_table = "commenti";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");

}

class Produttore extends \Syrius\Model\Model {
	protected $_table = "produttore";
	protected $ragioneSociale = array("type" => "varchar", "primary" => true);
    protected $dataFondazione = array("type" => "datetime", "format" => "Y-m-d");
}

class Prodotto extends \Syrius\Model\Model {
    protected $_table = "prodotto";
	protected $id = array("type" => "int", "primary" => true, "serial" => true, "comment" => "Autoincremento");
	protected $nome = array("type" => "varchar");
    protected $produttore = array("type" => "relation", "extra_type" => "one", "mapper" => "produttore");
}


?>